package com.cx.interact.client.bigWheel.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cx.base.apiModel.ApiModel;
import com.cx.base.autoDoc.annotations.AutoDocField;
import com.cx.base.autoDoc.annotations.AutoDocMethod;
import com.cx.base.autoDoc.annotations.AutoDocType;
import com.cx.base.controller.BaseController;
import com.cx.interact.interfaces.rule.service.RuleService;

/**
 * cenxi 2017-10-18
 * */
@Controller("test")
@AutoDocType("规则判断")
public class RuleController extends BaseController{

	@Reference
	private RuleService ruleService;
	
	@SuppressWarnings("rawtypes")
	@RequestMapping
	@ResponseBody
	@AutoDocMethod(name = "查询用户在活动中参与次数",  desc="全为必传参数")
	public ApiModel queryUserTime(@AutoDocField("活动模板ID") String templateId,@AutoDocField("活动ID") String actId,@AutoDocField("用户唯一码") String uniqueCode){
		try {
			ApiModel am = ruleService.queryUserTime(templateId, actId, uniqueCode);
			return am;
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return buildErrorMsg(null, DATA_ERROR, FAIL);
	}
}
